import { Injectable } from '@nestjs/common';
import { Repository } from 'typeorm';
import { MallUser } from '@/entities/MallUser';
import { InjectRepository } from '@nestjs/typeorm';
import { PageQuery, PageResult } from '@/common/interfaces/Pagination';
import { BuildPagination } from '@/common/utils/page.heler';

@Injectable()
export class ClientService {
  constructor(@InjectRepository(MallUser) private readonly clientRepository: Repository<MallUser>) {}

  async clientsPageQuery(params: PageQuery): Promise<PageResult<MallUser>> {
    return BuildPagination(this.clientRepository.createQueryBuilder(), params);
  }
}
